package jvm.t1;

/**
 * Remarks: StringTable垃圾回收机制
 * -Xmx10m -XX:+PrintStringTableStatistics -XX:+PrintGCDetails -verbose:gc
 * Class name :Demo1_7
 * Date :2023/2/10 10:05
 * Author:杨俊源
 */
public class Demo1_7 {

    public static void main(String[] args) {
        int i = 0;
        try {
            for (int j = 0; j < 10000; j++) {
                String.valueOf(j).intern();
                i++;
            }
        }catch (Throwable e){
            e.printStackTrace();
        }finally {
            System.out.println(i);
        }
    }
}
